import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '学生姓名',
    align:"center",
    dataIndex: 'usid_dictText'
   },
  /* {
    title: '学校编码',
    align:"center",
    dataIndex: 'xxbm'
   },*/
   /*{
    title: '学生ID 天波',
    align:"center",
    dataIndex: 'studentId'
   },
   {
    title: '学校组织ID 天波',
    align:"center",
    dataIndex: 'organizationId'
   },*/
   {
    title: '当月剩余通话时间',
    align:"center",
    dataIndex: 'monthDuration'
   },
   {
    title: '包月规则有效期',
    align:"center",
    dataIndex: 'ruleValidDate'
   },
   {
    title: '加量包剩余通话时长(分)',
    align:"center",
    dataIndex: 'chargingDuration'
   },
   {
    title: '加量包有效期',
    align:"center",
    dataIndex: 'chargingValidDate'
   },
  /* {
    title: '创建时间',
    align:"center",
    dataIndex: 'createDate'
   },
   {
    title: '更新时间',
    align:"center",
    dataIndex: 'updateDate'
   },*/
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: '学生姓名',
    field: 'usid',
    component: 'JSearchSelect',
    componentProps:{
      dict:"ss_person,name,id",
      pageSize:5,
      async:true,
    }
  },
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '学生姓名',
    field: 'usid',
    component: 'JSearchSelect',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入usid!'},
          ];
     },
    dynamicDisabled:true,
    componentProps:{
      dict:"ss_person,name,id"
    }
  },
/*  {
    label: '学校编码',
    field: 'xxbm',
    component: 'Input',
  },*/
 /* {
    label: '学生ID 天波',
    field: 'studentId',
    component: 'InputNumber',
  },
  {
    label: '学校组织ID 天波',
    field: 'organizationId',
    component: 'InputNumber',
  },*/
  {
    label: '当月剩余通话时间',
    field: 'monthDuration',
    component: 'InputNumber',
    dynamicDisabled:true,
  },
  {
    label: '包月规则有效期',
    field: 'ruleValidDate',
    component: 'Input',
    dynamicDisabled:true,
  },
  {
    label: '加量包剩余通话时长（分）',
    field: 'chargingDuration',
    component: 'InputNumber',
    dynamicDisabled:true,
  },
  {
    label: '加量包有效期',
    field: 'chargingValidDate',
    component: 'Input',
    dynamicDisabled:true,
  },
  /*{
    label: '创建时间',
    field: 'createDate',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '更新时间',
    field: 'updateDate',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: 'id',
    field: 'id',
    component: 'Input',
  },*/
];

// 高级查询数据
export const superQuerySchema = {
  usid: {title: 'usid',order: 0,view: 'number', type: 'number',},
  xxbm: {title: 'xxbm',order: 1,view: 'text', type: 'string',},
  studentId: {title: '学生ID 天波',order: 2,view: 'number', type: 'number',},
  organizationId: {title: '学校组织ID 天波',order: 3,view: 'number', type: 'number',},
  monthDuration: {title: '当月剩余通话时间',order: 4,view: 'number', type: 'number',},
  ruleValidDate: {title: '包月规则有效期',order: 5,view: 'text', type: 'string',},
  chargingDuration: {title: '加量包剩余通话时长单位：分钟',order: 6,view: 'number', type: 'number',},
  chargingValidDate: {title: '加量包有效期',order: 7,view: 'text', type: 'string',},
  createDate: {title: 'createDate',order: 8,view: 'datetime', type: 'string',},
  updateDate: {title: 'updateDate',order: 9,view: 'datetime', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
